home *** CD-ROM | disk | FTP | other *** search
- Path: news.epix.net!usenet
- From: hphilips@epix.net (Harry Philips)
- Newsgroups: comp.lang.c
- Subject: Re: help with pi algorithm
- Date: 29 Jan 1996 03:42:03 GMT
- Organization: epix.net
- Message-ID: <4ehfmb$1kn@guava.epix.net>
- References: <0fc_9601240111@csource.blaze.net.au>
- NNTP-Posting-Host: cpbgppp67.epix.net
- X-Newsreader: WinVN 0.92.2
-
- In article <0fc_9601240111@csource.blaze.net.au>, Andrew.Nesbit@f396.n634.z3.fidonet.org (Andrew Nesbit) says:
-
- >
- >I am a newbie C programmer trying to write an algorithm to work out the
- >value of pi fairly accurately.
-
- >Any comments please???
- >
- >Also, are there any 'standard' algorithm books which would demonstrate this
- >sort of programming technique?
-
- The other respondants to your query I've seen do not pick up on your
- accuracy requirement. Another suggestion: get a copy of SNIPPETS, an
- archive of C functions in C source code form. The file is big and contains
- more than 300 functions, mostly in C but a few are in assembler and one
- is in AWK. One place to look is the ftp site at oak.oakland.edu. The MSDOS
- directory in /SimTel has a /C subdirectory if I remember correctly. The
- file name should be something likd SNIP95mm.ZIP where mm is the month of
- release. My copy which is one release backlevel is almost 400K.
-
- Back to your question. The PI function included calculates the value of PI
- to some 60,000 decimal places and you can dig the algorithm used out of the
- source code with a bit of excruciating effort.
-
- Cheers,
-
- Harry
-
-